ASCII INPUT

The meter receives commands and setup data. The meter may receive one of 8 commands: P, G, W, R, V, SC, SG, and SP. Each of these commands are explained in detail in the following pages. Each is a single letter preceded by the preamble string of the following 3 characters: @U?. For example, Put reads @U?P. The @ U and ? characters reduce the probability of noise patterns and aid in generating an acceptable command. The Put command is followed by 42 hex characters of desired setup data. All commands are terminated with a carriage return, indicated by

<CR>.

@U?P<CR>
@U?G<CR>
@U?W<CR>
@U?R<CR>
@U?V<CR>
@U?SC<CR>
@U?SGaa<CR>
@U?SPaadd<CR>

'Put' Command @ U?P (setup data) <CR>
Sends setup data to the meter. The meter then stores data into its active memory and starts making measurements using the new setup parameters.

'Get' Command @ U?G <CR>
Sends the current setup parameters from the meter's active memory to the computer. Use the 'Get' command after the 'PUT' command to verify that the meter has correct setup parameters.


'Write' Command @ U?W <CR>
Transfers the setup data in the meter's active (volatile) memory to nonvolatile memory. Once the setup data is transferred to the nonvolatile memory it becomes a stored program. A program may be active, but not stored, by executing a 'Put' command or, entered from the keyboard. Stored programs are not affected when you recall the meter or power loss occurs. When power is restored or the recall is complete, stored program data resides in both the active and nonvolatile memory.

'Read' Command @ U?R <CR>
Requests the meter to read (transfer) the setup data from the non-volatile memory into the active memory for use in the measurements that follow and to send this setup data to the computer.

'Print' Command @U?V <CR>
Works as a print request and sends out one measurement data. This command only works when you select RTS message handshake and the RTS input is false.

Single 'GET' Command @U?SGaa <CR>
Two ASCII characters sends the content of aa address in memory. aa are two ASCII characters of 0 - 9 and A - F. aa is a hexadecimal address of memory. Refer to the Table 8-3 for available memory location for this command.

Table 8-3
Memory Addresses Accessed by Single 'GET' and Single 'PUT' Commands
aa
Description
aa
Description
29
Function
2F
30
31
SCALE LSB
SCALE 2nd byte
SCALE MSB
2A
Decimal point
32
33
34
SCALE LSB
SCALE 2nd byte
SCALE MSB
2B
Configuration
35
36
37
Setpoint Low LSB
Setpoint Low 2nd Byte
Setpoint Low MSB
2C
Analog output configuration
38
39
3A
Setpoint Low LSB
Setpoint Low 2nd Byte
Setpoint Low MSB
2D
2E
Gate time: low byte
Gate time: High byte
3B
Calibration Number
   
3C
3D
3E
Analog Output Offset LSB
Analog Output Offset MSB
Analog Output Scale

Single 'PUT' Command @U?SPaadd <CR>
Puts the dd data in the aa memory address. aa and dd are each two ASCII characters, from 0 - 9 or A - F. aa consists of two hexadeci-mal digits of address and dd consists of two hexadecimal digits of data. Table 8-3 shows available address locations for this command.

Caution Caution: Use this command only with addresses (aa values) shown in Table 8-3.

Micro Controller Revision Command @U?SC <CR>
This command returns one ASCII character representing the revision number or letter of the micro controller program.

INTERFACING EXAMPLES
The meter can interface to any device with RS-232E communications. The output levels are ▒8 V and the inputs may accept up to ▒25 V. The pin connections are labeled for the meter to emulate DCE (Data Communications Equipment). Examples are given for connections to an IBM PC with D-25 and D-9 connectors. A 7' cable with two RJ-12 telephone jacks at two ends are provided with RS-232 option. The connector adapter for D-9 and D-25 are optional.
Meter Serial Port to a D-9 Connector


Figure 8-12.
Meter Serial Port to a D-9 Connector
Meter Serial Port to a D-25 Connector
Figure 8-13.
Meter Serial Port to a D-25 Connector

Meter to IBM PC - D-9 or D-25 Connector Table 8-4
Description
IBM PC (DTE)
D-25 Connector
IBM PC (DTE)
D-9 Connector
METER (DCE)
N/C
N/C
J2-1 No Connection
Request to Send
4
7
J2-2 RS-232 (RTS)
Received Data
3
2
J2-3 RS-232 OUT (TX)
Transmitted Data
2
3
J2-4 RS-232 IN (RX)
Signal Return
7
5
J2-5 Return (RTN)
N/C
N/C
J2-6 No Connection

PROGRAMMING CONSIDERATIONS

Communication Rate
If possible, use 9600 baud for communications instead of 1200. 9600 baud has a faster reading rate and less time is spent communicating. The table below details measurement and setup time:

Baud Rate Information Table 8-5
9600 Baud
1200 Baud
Measurements (9 Characters)
9.4 msec
75 msec
Setup data (43 Characters)
45.8 msec
360 msec

Modem Operation
You may connect the meter to a freestanding modem, such as the Hayes Smartmodem 1200, to transmit and receive data over phone lines. A typical controller would be an IBM PC with a Hayes Smartmodem 1200B plug-in modem.

Modem Concept
Figure 8-14. Modem Concept

Use a 1200 baud rate to receive measurement and setup data to be sent from the computer to the meter. Connect an auto answering modem to the meter to gather data from a remote location upon demand. If you send a command to the meter at 1200 baud while the meter's active memory is programmed for 9600 baud, the meter will automatically switch to 1200 baud. This prevents the modem application from being disabled when a setup parameter of 9600 baud is accidentally sent to the meter.


PARITY CHECKING
Although the meter includes an even parity bit with data sent out on the RS-232C interface, it does not check the data received for even parity.

TIMING
When you send a 'PUT' command to the meter, the command is accompanied by a string of 42 setup characters. The BASIC program statement PRINT #1, @U?P + SETUP$ puts the string into an output buffer for transmission and the BASIC program continues while the data is being transmitted. If, within a few lines, you execute the statement PRINT #1, @U?G, the @U?G is added to the end of the setup string in the buffer (which is still being transmitted). This causes the @U?G characters to be missed because each transmission from the computer must be completely received by the meter and the next measurement started before another command is issued. A statement FOR J=1 TO 300:NEXT J introduces enough delay to allow separation between commands.


PROGRAMMING EXAMPLE
50 ' **************************************************
60 ' COMMUNICATION EXAMPLE
100 ' THIS PROGRAM READS THE OUTPUT
110 ' *************************************************
150 CLS
170 PRINT "SET ALL CONFIGURATION DIGITS TO ZERO"
180 PRINT
200 INPUT "ENTER COM1 (1) OR COM2 (2) RS-232 PORT";W
220 IF W=1 THEN COMM$="COM1" ELSE COMM$="COM2"
240 INPUT "ENTER A SINGLE COMMAND (SC, SPaadd, V, ... ";BB$
270 GOSUB 1000
280 PRINT
290 PRINT RES$
330 INPUT "ENTER COMMAND, TO REPEAT, S TO START OVER";AA$
340 IF AA$="S" OR AA$="s" THEN 200
345 IF AA$<>"" THEN BB$=AA$
350 GOTO 270
450 END
1000 B$=""
1100 CR$=CHR$(13)
1200 CLOSE: OPEN COMM$+":9600,E,7,1,DS,CS,RS" AS #1
1300 IF BB$="" THEN BB$="V"
1350 PRINT #1, "@U?"+BB$+CR$;
1370 PRINT "WAITING .... ";
1400 FOR X=1 TO 20: NEXT X
1500 PRINT ".";
1550 N=N+1
1570 IF N > 1000 THEN RES$="NO ANSWER":GOTO 2000
1600 IF LOC(1)=0 THEN 1400
1650 ON ERROR GOTO 1400
1700 A$=INPUT$(LOC(1),#1)
1800 B$=B$+A$
1850 Q=INSTR(B$,CR$)
1900 IF Q=0 THEN 1500
1950 RES$=LEFT$(B$,Q-1)
2000 N=0
2100 CLOSE #1
2200 RETURN
ASCII INPUT
The meter receives commands and setup data. The meter may receive one of 8 commands: P, G, W, R, V, SC, SG, and SP. Each of these commands are explained in detail in the following pages. Each is a single letter preceded by the preamble string of the following 3 characters: @U?. For example, Put reads @U?P. The @ U and ? characters reduce the probability of noise patterns and aid in generating an acceptable command. The Put command is followed by 42 hex characters of desired setup data. All commands are terminated with a carriage return, indicated by <CR>.

@U?P<CR>
@U?G<CR>
@U?W<CR>
@U?R<CR>
@U?V<CR>
@U?SC<CR>
@U?SGaa<CR>
@U?SPaadd<CR>

'Put' Command @ U?P (setup data) <CR>
Sends setup data to the meter. The meter then stores data into its active memory and starts making measurements using the new setup parameters.

'Get' Command @ U?G <CR>
Sends the current setup parameters from the meter's active memory to the computer. Use the 'Get' command after the 'PUT' command to verify that the meter has correct setup parameters.


'Write' Command @ U?W <CR>
Transfers the setup data in the meter's active (volatile) memory to nonvolatile memory. Once the setup data is transferred to the nonvolatile memory it becomes a stored program. A program may be active, but not stored, by executing a 'Put' command or, entered from the keyboard. Stored programs are not affected when you recall the meter or power loss occurs. When power is restored or the recall is complete, stored program data resides in both the active and nonvolatile memory.

'Read' Command @ U?R <CR>
Requests the meter to read (transfer) the setup data from the non-volatile memory into the active memory for use in the measurements that follow and to send this setup data to the computer.

'Print' Command @U?V <CR>
Works as a print request and sends out one measurement data. This command only works when you select RTS message handshake and the RTS input is false.

Single 'GET' Command @U?SGaa <CR>
Two ASCII characters sends the content of aa address in memory. aa are two ASCII characters of 0 - 9 and A - F. aa is a hexadecimal address of memory. Refer to the Table 8-3 for available memory location for this command.

Table 8-3
Memory Addresses Accessed by Single 'GET' and Single 'PUT' Commands
aa
Description
aa
Description
29
Function
2F
30
31
SCALE LSB
SCALE 2nd byte
SCALE MSB
2A
Decimal point
32
33
34
SCALE LSB
SCALE 2nd byte
SCALE MSB
2B
Configuration
35
36
37
Setpoint Low LSB
Setpoint Low 2nd Byte
Setpoint Low MSB
2C
Analog output configuration
38
39
3A
Setpoint Low LSB
Setpoint Low 2nd Byte
Setpoint Low MSB
2D
2E
Gate time: low byte
Gate time: High byte
3B
Calibration Number
   
3C
3D
3E
Analog Output Offset LSB
Analog Output Offset MSB
Analog Output Scale

Single 'PUT' Command @U?SPaadd <CR>
Puts the dd data in the aa memory address. aa and dd are each two ASCII characters, from 0 - 9 or A - F. aa consists of two hexadeci-mal digits of address and dd consists of two hexadecimal digits of data. Table 8-3 shows available address locations for this command.

Caution Caution: Use this command only with addresses (aa values) shown in Table 8-3.

Micro Controller Revision Command @U?SC <CR>
This command returns one ASCII character representing the revision number or letter of the micro controller program.

INTERFACING EXAMPLES
The meter can interface to any device with RS-232E communications. The output levels are ▒8 V and the inputs may accept up to ▒25 V. The pin connections are labeled for the meter to emulate DCE (Data Communications Equipment). Examples are given for connections to an IBM PC with D-25 and D-9 connectors. A 7' cable with two RJ-12 telephone jacks at two ends are provided with RS-232 option. The connector adapter for D-9 and D-25 are optional.
Meter Serial Port to a D-9 Connector


Figure 8-12.
Meter Serial Port to a D-9 Connector
Meter Serial Port to a D-25 Connector
Figure 8-13.
Meter Serial Port to a D-25 Connector

Meter to IBM PC - D-9 or D-25 Connector Table 8-4
Description
IBM PC (DTE)
D-25 Connector
IBM PC (DTE)
D-9 Connector
METER (DCE)
N/C
N/C
J2-1 No Connection
Request to Send
4
7
J2-2 RS-232 (RTS)
Received Data
3
2
J2-3 RS-232 OUT (TX)
Transmitted Data
2
3
J2-4 RS-232 IN (RX)
Signal Return
7
5
J2-5 Return (RTN)
N/C
N/C
J2-6 No Connection

PROGRAMMING CONSIDERATIONS

Communication Rate
If possible, use 9600 baud for communications instead of 1200. 9600 baud has a faster reading rate and less time is spent communicating. The table below details measurement and setup time:

Baud Rate Information Table 8-5
9600 Baud
1200 Baud
Measurements (9 Characters)
9.4 msec
75 msec
Setup data (43 Characters)
45.8 msec
360 msec

Modem Operation
You may connect the meter to a freestanding modem, such as the Hayes Smartmodem 1200, to transmit and receive data over phone lines. A typical controller would be an IBM PC with a Hayes Smartmodem 1200B plug-in modem.

Modem Concept
Figure 8-14. Modem Concept

Use a 1200 baud rate to receive measurement and setup data to be sent from the computer to the meter. Connect an auto answering modem to the meter to gather data from a remote location upon demand. If you send a command to the meter at 1200 baud while the meter's active memory is programmed for 9600 baud, the meter will automatically switch to 1200 baud. This prevents the modem application from being disabled when a setup parameter of 9600 baud is accidentally sent to the meter.


PARITY CHECKING
Although the meter includes an even parity bit with data sent out on the RS-232C interface, it does not check the data received for even parity.

TIMING
When you send a 'PUT' command to the meter, the command is accompanied by a string of 42 setup characters. The BASIC program statement PRINT #1, @U?P + SETUP$ puts the string into an output buffer for transmission and the BASIC program continues while the data is being transmitted. If, within a few lines, you execute the statement PRINT #1, @U?G, the @U?G is added to the end of the setup string in the buffer (which is still being transmitted). This causes the @U?G characters to be missed because each transmission from the computer must be completely received by the meter and the next measurement started before another command is issued. A statement FOR J=1 TO 300:NEXT J introduces enough delay to allow separation between commands.


PROGRAMMING EXAMPLE
50 ' **************************************************
60 ' COMMUNICATION EXAMPLE
100 ' THIS PROGRAM READS THE OUTPUT
110 ' *************************************************
150 CLS
170 PRINT "SET ALL CONFIGURATION DIGITS TO ZERO"
180 PRINT
200 INPUT "ENTER COM1 (1) OR COM2 (2) RS-232 PORT";W
220 IF W=1 THEN COMM$="COM1" ELSE COMM$="COM2"
240 INPUT "ENTER A SINGLE COMMAND (SC, SPaadd, V, ... ";BB$
270 GOSUB 1000
280 PRINT
290 PRINT RES$
330 INPUT "ENTER COMMAND, TO REPEAT, S TO START OVER";AA$
340 IF AA$="S" OR AA$="s" THEN 200
345 IF AA$<>"" THEN BB$=AA$
350 GOTO 270
450 END
1000 B$=""
1100 CR$=CHR$(13)
1200 CLOSE: OPEN COMM$+":9600,E,7,1,DS,CS,RS" AS #1
1300 IF BB$="" THEN BB$="V"
1350 PRINT #1, "@U?"+BB$+CR$;
1370 PRINT "WAITING .... ";
1400 FOR X=1 TO 20: NEXT X
1500 PRINT ".";
1550 N=N+1
1570 IF N > 1000 THEN RES$="NO ANSWER":GOTO 2000
1600 IF LOC(1)=0 THEN 1400
1650 ON ERROR GOTO 1400
1700 A$=INPUT$(LOC(1),#1)
1800 B$=B$+A$
1850 Q=INSTR(B$,CR$)
1900 IF Q=0 THEN 1500
1950 RES$=LEFT$(B$,Q-1)
2000 N=0
2100 CLOSE #1
2200 RETURN
Help Price List Specifications Print Manual Manuals Home
 Home Home  Table of Contents TOC  Back Back  Next Next